package com.enzoism.testspring.transaction;

import com.enzoism.testspring.transaction.tx.ProxyFactory;
import com.enzoism.testspring.transaction.model.StudentDemo;
import com.enzoism.testspring.transaction.service.StudentService;
import com.enzoism.testspring.transaction.service.StudentServiceImpl;

public class SpringMainTx {

    public static void main(String[] args) {

        StudentService userService2 = new ProxyFactory(new StudentServiceImpl()).createProxy(StudentServiceImpl.class);
        System.out.println("开始执行insert方法");
        System.out.println("方法返回值 ： " + userService2.insert(new StudentDemo()));

        System.out.println("====================================");

        System.out.println("开始执行insert2方法");
        System.out.println(userService2.insert2(new StudentDemo()));
    }
}